//
//  ProfessorViewController.m
//  beautifulHome
//
//  Created by lanou on 15/12/17.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "ProfessorViewController.h"
#import "LORequestManger.h"
#import "ProfessorModel.h"
#import "ProfessorTableViewCell.h"
#import "WorkTableViewCell.h"
#import "tableTiew1AndTableTiew2.h"
#import "BlurImageView.h"
#import "MJRefresh.h"
#import "BrowseThreeTableViewCell.h"
#import "BrowseModel.h"
#import "DetailTowTableViewController.h"

#import "DetailViewController.h"

static NSInteger i = 0;
static NSInteger j = 0;
static NSInteger n = 1;

@interface ProfessorViewController ()<UITableViewDataSource, UITableViewDelegate, UIScrollViewDelegate>

@property (nonatomic, strong) NSMutableArray *array;

@property (nonatomic, strong) NSMutableArray *array2;

@property (nonatomic, strong) tableTiew1AndTableTiew2 *scrollView;

@property (nonatomic, strong) UISegmentedControl *segmentedControl;

@property (nonatomic, strong) CityTableViewController *cityTVC;


@property (nonatomic, strong) UIScrollView *scrollView2;

@property (nonatomic, strong) UIButton *button1;

@property (nonatomic, strong) UIButton *button2;

@property (nonatomic, strong) UITableView *tableView;

// 存放hot_zone 数组

// 存放show_city 数组
@property (nonatomic, strong) NSMutableArray *array4;


// 存放show_city 数组里的name
@property (nonatomic, strong) NSMutableArray *array5;

//// 存放show_city 数组里的id
//@property (nonatomic, strong) NSMutableArray *array7;


@property (nonatomic, strong) NSMutableArray *array6;

@property (nonatomic, strong) BrowseModel *browseModel;


@end

@implementation ProfessorViewController
// 懒加载
- (NSMutableArray *)array
{
    if (!_array) {
        _array = [[NSMutableArray alloc] init];
    }
    return _array;
}

- (NSMutableArray *)array2
{
    if (!_array2) {
        _array2 = [[NSMutableArray alloc] init];
    }
    return _array2;
}

- (NSMutableArray *)array3
{
    if (!_array3) {
        _array3 = [[NSMutableArray alloc] init];
    }
    return _array3;
}

- (NSMutableArray *)array4
{
    if (!_array4) {
        _array4 = [[NSMutableArray alloc] init];
    }
    return _array4;
}

- (NSMutableArray *)array5
{
    if (!_array5) {
        _array5 = [[NSMutableArray alloc] init];
    }
    return _array5;
}


- (NSMutableArray *)array6
{
    if (!_array6) {
        _array6 = [[NSMutableArray alloc] init];
    }
    return _array6;
}



- (void)chooseUrl:(NSInteger )k {
    
    NSString *str2 = [NSString string];
    
    if (self.city == nil) {
        
        NSString *str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_list?sort=&page=%ld&zone=", (long)i];
        
        str2 = [str stringByAppendingFormat:@"&filter_price_range=%ld",(long)k];
        
        [LORequestManger GET:str2 success:^(id response) {
            
            NSDictionary *dic = (NSDictionary *)response;
            
            NSDictionary *dataDict = dic[@"data"];
            NSDictionary *advancedDict = [NSDictionary dictionary];
            if (_segmentedControl.selectedSegmentIndex == 0) {
                advancedDict = dataDict[@"advanced_pro_list"];
            } else {
                advancedDict = dataDict[@"advanced_pro_gz_list"];
                
            }
            NSArray *listArray = advancedDict[@"list"];
            for (NSDictionary *dic in listArray) {
                ProfessorModel *model = [[ProfessorModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                [self.array addObject:model];
            }
            
            [self.scrollView.tableView1 reloadData];
            
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            
        }];
        
        
    }
    
        for (int i = 0 ; i < self.array3.count; i ++) {
            
            CityModel *model = self.array3[i];
            
            if ([self.city isEqualToString:model.name]) {

        
        NSString *str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_list?sort=&page=%ld&zone=%@", (long)i, model.ID];
        
        str2 = [str stringByAppendingFormat:@"&filter_price_range=%ld",(long)k];
                
                [LORequestManger GET:str2 success:^(id response) {
                    
                    NSDictionary *dic = (NSDictionary *)response;
                    
                    NSDictionary *dataDict = dic[@"data"];
                    NSDictionary *advancedDict = [NSDictionary dictionary];
                    if (_segmentedControl.selectedSegmentIndex == 0) {
                        advancedDict = dataDict[@"advanced_pro_list"];
                    } else {
                        advancedDict = dataDict[@"advanced_pro_gz_list"];
                        
                    }
                    NSArray *listArray = advancedDict[@"list"];
                     [self.array removeAllObjects];
                    for (NSDictionary *dic in listArray) {
                        ProfessorModel *model = [[ProfessorModel alloc] init];
                        [model setValuesForKeysWithDictionary:dic];
                        [self.array addObject:model];
                    }
                    
                    [self.scrollView.tableView1 reloadData];
                    
                } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                    
            }];
          
    }
    
        }
}


- (void)cityUrl {
    
    [LORequestManger GET:@"http://api.meilijia.com/app/advanced_pro_zone_list" success:^(id response) {
        
        NSDictionary *dic = (NSDictionary *)response;
        
        NSDictionary *dataDict = dic[@"data"];
        NSDictionary *advancedDict = [NSDictionary dictionary];
       
        advancedDict = dataDict[@"advanced_pro_zone_list"];
        
        NSArray *hot_zoneArray = advancedDict[@"hot_zone"];
        for (NSDictionary *dic in hot_zoneArray) {
            CityModel *model = [[CityModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.array3 addObject:model];
        }
        
        
        NSArray *show_cityArray = advancedDict[@"show_city"];
        
        for (int i = 0; i < show_cityArray.count; i ++) {
        NSArray *city_listArray = show_cityArray[i][@"city_list"];
        for (NSDictionary *dic in city_listArray) {
            CityModel *model = [[CityModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.array4 addObject:model];
            [self.array5 addObject:model.name];
        }
    }
        [self.cityTVC.tableView reloadData];
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];

    
    
}


- (void)jsonUrl {
    
    NSString *str = [NSString string];
    
    if (self.city == nil) {
        switch (_segmentedControl.selectedSegmentIndex) {
            case 0:
                str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_list?page=%ld&sort=&zone=", (long)i];
                break;
            case 1:
                str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_gz_list?page=%ld&sort=&zone=", (long)i];
            default:
                break;
        }
        
        [LORequestManger GET:str success:^(id response) {
            
            NSDictionary *dic = (NSDictionary *)response;
            
            NSDictionary *dataDict = dic[@"data"];
            NSDictionary *advancedDict = [NSDictionary dictionary];
            if (_segmentedControl.selectedSegmentIndex == 0) {
                advancedDict = dataDict[@"advanced_pro_list"];
            } else {
                advancedDict = dataDict[@"advanced_pro_gz_list"];
                
            }
            NSArray *listArray = advancedDict[@"list"];
            for (NSDictionary *dic in listArray) {
                ProfessorModel *model = [[ProfessorModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                [self.array addObject:model];
                
            }
            
            [self cityUrl];
            
            [self.scrollView.tableView1 reloadData];
            
            
            
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            
        }];
    }
    
    for (int i = 0 ; i < self.array3.count; i ++) {
        
        CityModel *model = self.array3[i];
    
        if ([self.city isEqualToString:model.name]) {
        
        switch (_segmentedControl.selectedSegmentIndex) {
            case 0:
                str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_list?page=%ld&sort=&zone=%@", (long)i, model.ID];
                break;
            case 1:
                str = [NSString stringWithFormat:@"http://api.meilijia.com/app/advanced_pro_gz_list?page=%ld&sort=&zone=%@", (long)i, model.ID];
            default:
                break;
        }
        
        [LORequestManger GET:str success:^(id response) {
            
            NSDictionary *dic = (NSDictionary *)response;
            
            NSDictionary *dataDict = dic[@"data"];
            NSDictionary *advancedDict = [NSDictionary dictionary];
            if (_segmentedControl.selectedSegmentIndex == 0) {
                advancedDict = dataDict[@"advanced_pro_list"];
            } else {
                advancedDict = dataDict[@"advanced_pro_gz_list"];
                
            }
            NSArray *listArray = advancedDict[@"list"];
            for (NSDictionary *dic in listArray) {
                ProfessorModel *model = [[ProfessorModel alloc] init];
                [model setValuesForKeysWithDictionary:dic];
                [self.array addObject:model];
                
            }
            
            [self cityUrl];
            
            [self.scrollView.tableView1 reloadData];
            
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            
        }];
    }
  }
    
}


- (void)jsonUrl2 {
    
    NSString *str = [NSString string];
    
    switch (_segmentedControl.selectedSegmentIndex) {
        case 0:
            str = [NSString stringWithFormat:@"http://api.meilijia.com/app/work_list?page=%ld&city_id=", (long)j];
            break;
        case 1:
            str = [NSString stringWithFormat:@"http://api.meilijia.com/app/pro_gz_work_list?page=%ld&city_id=", (long)j];
        default:
            break;
    }
    
    [LORequestManger GET:str success:^(id response) {
        
        NSDictionary *dic = (NSDictionary *)response;
        
        NSDictionary *dataDict = dic[@"data"];
        NSDictionary *proDict = [NSDictionary dictionary];
        if (_segmentedControl.selectedSegmentIndex == 0) {
            proDict = dataDict[@"work_list"];
        } else {
            proDict = dataDict[@"pro_gz_work_list"];
            
        }
        NSArray *listArray = proDict[@"collections"];
        for (NSDictionary *dic in listArray) {
            BrowseModel *model = [[BrowseModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.array2 addObject:model];
            
        }
        
        [self.scrollView.tableView2 reloadData];
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
    
}




- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self jsonUrl];
   
    [self jsonUrl2];
    
     self.view.backgroundColor = [UIColor whiteColor];

    
    // 创建分段控制器
    _segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"设计师", @"工长"]];
    _segmentedControl.tag = 111;
    _segmentedControl.frame = CGRectMake(kWidth / 4, 25, kWidth / 2, 30);
    _segmentedControl.tintColor = [UIColor orangeColor];
    _segmentedControl.selectedSegmentIndex = 0;
    
   
    
    [_segmentedControl addTarget:self action:@selector(changeControllAction:) forControlEvents:UIControlEventValueChanged];
    // 将分段控制器添加到导航控制器上
    [self.navigationController.view  addSubview:_segmentedControl];
    
    
    // 添加筛选按钮
    UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"筛选" style:(UIBarButtonItemStylePlain) target:self action:@selector(rightAction)];
    // 改变筛选按钮颜色
    rightBarButton.tintColor = [UIColor orangeColor];
    self.navigationItem.rightBarButtonItem = rightBarButton;
    
    // 添加城市按钮
    if (self.city == nil) {
            UIBarButtonItem *letfBarButton = [[UIBarButtonItem alloc] initWithTitle:@"城市 v" style:(UIBarButtonItemStylePlain) target:self action:@selector(leftAction)];
        // 改变筛选按钮颜色
        letfBarButton.tintColor = [UIColor orangeColor];
        self.navigationItem.leftBarButtonItem = letfBarButton;
    } else {
         UIBarButtonItem *letfBarButton = [[UIBarButtonItem alloc] initWithTitle:self.city style:(UIBarButtonItemStylePlain) target:self action:@selector(leftAction)];
        // 改变筛选按钮颜色
        letfBarButton.tintColor = [UIColor orangeColor];
        self.navigationItem.leftBarButtonItem = letfBarButton;
    }

 
    
    
    
    self.scrollView = [[tableTiew1AndTableTiew2 alloc]initWithFrame:CGRectMake(0, 10, kWidth, kHeight)];
    [self.scrollView setTableViewTarget:self];
    
    self.scrollView.tableView1.tag = 100;
    self.scrollView.tableView2.tag = 200;
    
    self.scrollView.delegate = self;
    
    [self.scrollView.tableView1 registerClass:[ProfessorTableViewCell class] forCellReuseIdentifier:@"professor"];
    
    [self.scrollView.tableView2 registerClass:[BrowseThreeTableViewCell class] forCellReuseIdentifier:@"cell1"];
    
    [self.view addSubview:self.scrollView];
  

    // 隐藏单元格分割线
    self.scrollView.tableView1.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    self.scrollView.tableView2.separatorStyle = UITableViewCellSeparatorStyleNone;

    self.scrollView.backgroundColor = [UIColor whiteColor];
    
    self.scrollView.tableView1.backgroundColor = [UIColor clearColor];
    self.scrollView.tableView2.backgroundColor = [UIColor clearColor];
     
    //下拉刷新(图片)
    __weak ProfessorViewController *professorVC = self;
    
    [self.scrollView.tableView1 addFooterWithCallback:^{
      
        i += 1;
        
        [professorVC jsonUrl];
        
        [professorVC chooseUrl:n];
        
        [professorVC.scrollView.tableView1 footerEndRefreshing];
    }];
    
   
    [self.scrollView.tableView2 addFooterWithCallback:^{
        
        j += 1;
        
        [professorVC jsonUrl2];
        
        [professorVC.scrollView.tableView2 footerEndRefreshing];
    }];
    
    
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 64, kWidth, 25)];
    view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:view];
    
    _button1  = [[UIButton alloc] initWithFrame:CGRectMake(kWidth/ 2 - 100, 5, 100, 15)];
    _button2  = [[UIButton alloc] initWithFrame:CGRectMake(kWidth/ 2 + 5, 5, 100, 15)];
    
    if (_segmentedControl.selectedSegmentIndex == 0) {
        
        [_button1 setTitle:@"找设计师" forState:(UIControlStateNormal)];
        [_button2 setTitle:@"看设计作品" forState:(UIControlStateNormal)];
    } else {
        
        [_button1 setTitle:@"找工长" forState:(UIControlStateNormal)];
        [_button2 setTitle:@"看施工项目" forState:(UIControlStateNormal)];
    }
    
    [_button1 setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    _button1.titleLabel.font = [UIFont systemFontOfSize:12];
    _button1.tag = 1;
    [_button1 addTarget:self action:@selector(toTV1) forControlEvents:(UIControlEventTouchUpInside)];
    [view addSubview:_button1];
    
    
    [_button2 setTitleColor:[UIColor grayColor] forState:(UIControlStateNormal)];
    _button2.titleLabel.font = [UIFont systemFontOfSize:12];
    _button2.tag = 2;
    [_button2 addTarget:self action:@selector(toTV2) forControlEvents:(UIControlEventTouchUpInside)];
    [view addSubview:_button2];
    

    
    
    self.tableView = [[UITableView alloc]initWithFrame:(CGRectMake(kWidth / 3, 64, (kWidth / 3) * 2, kHeight))];
    self.tableView.delegate =self;
    self.tableView.dataSource =self;
    [self.tableView registerClass:[ChooseTableViewCell class] forCellReuseIdentifier:@"cell11"];
    
    
}

// 点击segment 切换效果
- (void)changeControllAction:(UISegmentedControl *)segmentedControl {
    
    // 必须先清除数组里的数据，否则会出现重复单元格，并且设计师和工长的单元格出现在同一个界面
    [self.array removeAllObjects];
    
    [self jsonUrl];
    
    [self.array2 removeAllObjects];
    
    [self jsonUrl2];
    
    
    if (_segmentedControl.selectedSegmentIndex == 0) {
        
        [_button1 setTitle:@"找设计师" forState:(UIControlStateNormal)];
        [_button2 setTitle:@"看设计作品" forState:(UIControlStateNormal)];
    } else {
        
        [_button1 setTitle:@"找工长" forState:(UIControlStateNormal)];
        [_button2 setTitle:@"看施工项目" forState:(UIControlStateNormal)];
    }
    
}

// 点击筛选按钮时
- (void)rightAction {
    
    [self.view addSubview:self.tableView];
    
}

// 点击城市按钮时
- (void)leftAction {
    
    CityTableViewController *cityTVC = [[CityTableViewController alloc] init];
    
    cityTVC.array = self.array3;
    
    cityTVC.array1 = self.array4;
    
    self.segmentedControl.alpha = 0;
    
    
    [self.navigationController pushViewController:cityTVC animated:YES];
}


// 分区数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

// 分区行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    if ([tableView isEqual:_scrollView.tableView1]) {
        return self.array.count;
    }
    
    else if ([tableView isEqual:_scrollView.tableView2])
    
    {
        return self.array2.count;
    }
    
    else {
        return 6;
    }
    
}

// 单元格高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if ([tableView isEqual:_scrollView.tableView1]) {
        return 210;
    }
    
    else if ([tableView isEqual:_scrollView.tableView2])
    {
        return kHeight / 2 + 110;
    }
    
    else {
        return 40;
    }
}

// 加载单元格
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if ([tableView isEqual:_scrollView.tableView1]) {
     
        ProfessorTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"professor" forIndexPath:indexPath];
        
        ProfessorModel *model = _array[indexPath.row];
        
        cell.model = model;
        
        if (_segmentedControl.selectedSegmentIndex == 0) {
            // 需要先将工长界面的评价label的内容置空，否则会出现重复数据问题
            cell.reviewLabel.text = nil;
            cell.reviewStarLabel.text =  nil;
            
            cell.priceLabel.text = [NSString stringWithFormat:@"￥%@-%@/平米", model.pro_price_min, model.pro_price_max];
            
            cell.priceLabel.textColor= [UIColor orangeColor];
            cell.verifiedLabel.text = [NSString stringWithFormat:@"%@ 套已验证作品", model.verified_work_count];
            
        } else {
            // 需要先将设计师界面的价格label的内容置空，否则会出现重复数据问题
            cell.priceLabel.text = nil;
            //  cell.priceLabel.backgroundColor = [UIColor whiteColor];
            
            
            cell.reviewLabel.text = [NSString stringWithFormat:@"%@条评论", model.review_count];
            cell.reviewStarLabel.text = [NSString stringWithFormat:@"评分: %@", model.pro_ratings];
            cell.reviewStarLabel.textColor = [UIColor orangeColor];
            cell.verifiedLabel.text = [NSString stringWithFormat:@"%@ 个已验证项目", model.verified_work_count];
            
        }
        
        return cell;

    }
    
    else if ([tableView isEqual:_scrollView.tableView2])
        {
    
        BrowseThreeTableViewCell *browseCell = [tableView dequeueReusableCellWithIdentifier:@"cell1" forIndexPath:indexPath];
        
        BrowseModel *browseModel = _array2[indexPath.row];
        
        browseCell.browseModel = browseModel;
        
        return browseCell;
    }
        
    else {
        
        ChooseTableViewCell *chooseCell = [tableView dequeueReusableCellWithIdentifier:@"cell11" forIndexPath:indexPath];
        
        NSArray *array = @[@"全部", @"30-50元/平米", @"50-100元/平米", @"100-150元/平米", @"150-200元/平米", @"200元/平米以上"];
//        NSArray *array1 = @[@"全部",@"完工照", @"施工照", @"效果图", @"施工图", @"平面方案"];
//        
//        if ([tableView isEqual:_scrollView.tableView1])
//        {
           chooseCell.textLabel.text = [array objectAtIndex:indexPath.row];
        //           }
        
//        if ([tableView isEqual:_scrollView.tableView2])
//        {
//           chooseCell.textLabel.text = [array1 objectAtIndex:indexPath.row];
//        }
        
        return chooseCell;
    }
   


}


// scrollow 开始拖拽时
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    
    if (scrollView.contentOffset.x / kWidth == 1) {
        [_button2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [_button1 setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    }
    
    if (scrollView.contentOffset.x / kWidth == 0)
    {
        [_button1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [_button2 setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    }
    
}


//  点击单元格时
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if ([tableView isEqual:_scrollView.tableView1]) {
        
        DetailViewController *detailVC  = [[DetailViewController alloc] init];
        
        ProfessorModel *model = _array[indexPath.row];
        
        detailVC.professorModel = model;
        
        detailVC.c = _segmentedControl.selectedSegmentIndex;
        
      //  [self.navigationController pushViewController:detailVC animated:YES];
        [self presentViewController:detailVC animated:YES completion:nil];
        
    }
    
    else if ([tableView isEqual:_scrollView.tableView2])
        
    {
       
        DetailTowTableViewController *detailTwoVC = [[DetailTowTableViewController alloc]init];
        
        self.browseModel = _array2[indexPath.row];
        
        detailTwoVC.browseModel = self.browseModel;
        
        [self presentViewController:detailTwoVC animated:YES completion:nil];
        
    }
    
    else {
        
        [self.tableView removeFromSuperview];

        if (_segmentedControl.selectedSegmentIndex == 0) {
            
            if (self.city == nil) {
                [self.array removeAllObjects];
                
                n = indexPath.row;
            } else {
                
                
                
            }
            
            [self chooseUrl:indexPath.row];
        }
        
    }
   
}

// 点击button1 时
- (void)toTV1 {
    
    [_scrollView setContentOffset:(CGPointMake(0, 0)) animated:NO];
    [_scrollView setFrame:CGRectMake(0, 10, kWidth, kHeight)];
    [_button2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [_button1 setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    
}

// 点击button2 时
- (void)toTV2 {
    
    [_scrollView setContentOffset:(CGPointMake(kWidth, 0)) animated:NO];
    [_scrollView setFrame:CGRectMake(0, 10, kWidth, kHeight)];
    [_button1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [_button2 setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
   
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
